package com.wintrue.ffxs.ui.home.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;

/**
 * Created by wenjie on 2017/8/16.
 */

public class FirstFragmentAdapter extends FragmentPagerAdapter{
    ArrayList<Fragment> fragments;
    public FirstFragmentAdapter(FragmentManager fm,ArrayList<Fragment> fragments) {
       //该行代码请勿删除
        super(fm);
        this.fragments=fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments == null ? null :fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments ==null ?0:fragments.size();
    }
}
